#ifndef _TEXT_OBJECT_H_
#define _TEXT_OBJECT_H_

#include "Object.h"
#include <string>

//Forward declaration to reduce dependencies
class FTFont;

/**
	A Text object. Also known as "Label" in other GUI frameworks
*/
class TextObject: public Object {
	std::string text;			//The text to display
	std::string font;			//The font to use
	float size;				//The size of the font to use
	FTFont* fontObj;			//The associated fontObj for rendering
	
	void setFontObject();		//Gets the appropriate font object from text, font, and size
	
	//No copying...
	TextObject(const TextObject&);
	TextObject& operator=(const TextObject&) {	return *this;	}
	
public:
	TextObject(const std::string& str = "TEXT UNSET", const std::string& font = "FreeSans.ttf", float size = 8);
	virtual ~TextObject()	{}

	void setText(const std::string& str);		//Sets the text string
	void setFont(const std::string& fnt);		//Sets the font string
	void setSize(float size);				//Sets the size value

	void draw(unsigned long timestamp);		//Renders the desired text in the desired format to the screen
	
	//Nothing associated with these
	void onLeftClick()	{}
	void onKeyPress()	{}
	void onRollOver()	{}
	
	//Realign when the window changes size
	void onRealign(float minX, float maxX, float minY, float maxY);
	
	//Get the dimensions of this object
	void getDimensions(double* width, double* height);
	
	//Load the object from xml
	void loadFromXML(ticpp::Node* node, int Z, Frame*);
};

#endif
